import request from '@/utils/request'
import * as url from "url";

/**
 * 查询预约
 * @param apmstatus
 * @param condition
 * @returns {*}
 */
export function getemrcasesizelistall(pageSize, pageNum, apmstatus, condition) {
    return request({
        url: '/selectAllBycondition?pageSize=' + pageSize + '&pageNum=' + pageNum + '&apmstatus=' + apmstatus + '&condition=' + condition,
        method: 'GET'
    })
}

/**
 * 申请预约
 * @param Id
 * @returns {*}
 */
export function updateapmstatus(Id) {
    return request({
        url: '/update?Id=' + Id + '&apmstatus=2',
        method: 'PUT'
    })
}

/**
 * 新建病例
 * @param from
 * @returns {*}
 * @constructor
 */
export function Newcase(from) {
    return request({
        url: '/saveByEmrCase',
        method: 'POST',
        data: from
    })
}

/**
 * 获取账户名
 * @constructor
 */
export function GetUserName() {
    return request({
        url: '/GetUserName',
        method: 'GET'
    })
}

/**
 * 获取账户id
 * @constructor
 */
export function GetUserId() {
    return request({
        url: '/GetDoctorId',
        method: 'GET'
    })
}

/**
 * 根据id删除预约
 * @param ID
 * @returns {*}
 */
export function deleteByID(ID) {
    return request({
        url: '/deleteByid?id=' + ID,
        method: 'DELETE'
    })
}

export function upload(files) {
    return request({
        url: '/upload',
        method: 'POST',
        data: files
    })
}